import React, { memo } from "react";
import { useRoutes } from "react-router-dom";
import routes from "./router";

import { Suspense } from "react";
import AppHeader from "./layout/app-header";
import AppFooter from "./layout/app-footer";

const App = memo(() => {
  return (
    <div>
      <AppHeader />
      <Suspense fallback="加载中">
        <div className="main">{useRoutes(routes)}</div>
      </Suspense>
      <AppFooter />
    </div>
  );
});
export default App;
